﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace DCT.AutoUpdate.Code.Downloader
{
    public abstract class SourceLocationProtocalProvider:IDisposable
    {
        public static SourceLocationProtocalProvider Create(string address) {
            SourceLocationProtocalProvider provider = null;
            if (address.StartsWith("http://", StringComparison.OrdinalIgnoreCase)
                || address.StartsWith("https://", StringComparison.OrdinalIgnoreCase)) {
                    provider = new HttpSourceLocationProtocalProvider();
            }
            return provider;
        }

        public abstract void GetStream(SourceLocation sl, out Stream stream ,out SourceInfo sourceInfo);

        public abstract void Dispose();
    }
}
